//========encoding:utf-8=========
/*
 * @describe:  三目运算符
 * @author:mhao
 * @copyright:chinasoft.cn
 * @date:2020年3月16日   下午10:37:46
 */
package edu.chinasoft.domain;

import java.util.ArrayList;
import java.util.List;

public class PageUtilForUser {
	private List<User> userList = new ArrayList<User>();
	private int pageUtil; // 分页单位
	private int pageNum; // 总页数
	private int recordNum; // 总记录数
	private int currentPage; // 当前页面
	public PageUtilForUser() {
	}
	
	public List<User> getUserList() {
		return userList;
	}
	public void setUserList(List<User> userList) {
		this.userList = userList;
	}
	public int getPageUtil() {
		return pageUtil;
	}
	public void setPageUtil(int pageUtil) {
		this.pageUtil = pageUtil;
	}
	public int getPageNum() {
		int result = (recordNum - 1) / pageUtil + 1;
		return result;
	}
	public int setPageNum(int pageNum) {
		return pageNum;
	}
	public int getRecordNum() {
		return recordNum;
	}
	public void setRecordNum(int recordNum) {
		this.recordNum = recordNum;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public int getPrePage() {
		int result = this.currentPage - 1;
		result = result >= 1 ? 1:result;
		return result;
	}

	public int getNextpage() {
		int result = this.currentPage + 1;
		result = result>this.getPageNum()?this.getPageNum():result;
		return result;
	}

	@Override
	public String toString() {
		return "PageUtilForUser [userList=" + userList + ", pageUtil=" + pageUtil + ", pageNum=" + pageNum
				+ ", recordNum=" + recordNum + ", currentPage=" + currentPage + "]";
	}
	
	
}
